package path

import (
	"os"
	"path/filepath"
	"strings"
)

func GetCurrentDir() string {
	//返回绝对路径  filepath.Dir(os.Args[0])去除最后一个元素的路径
	dir, err := filepath.Abs(filepath.Dir(os.Args[0]))
	if err != nil {
		panic(err)
	}

	//将\替换成/
	return strings.Replace(dir, "\\", "/", -1)
}
